<?php

namespace app\common\validate\xilumarket;

use think\Validate;

class Product extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
       // 'user_id' => ['require'],
        'category_id|分类' => ['require','gt:0'],
        'region_id|发布区域' => ['require','gt:0'],
        'name|商品名称' => ['require','length:1,50'],
        'content|商品描述'  =>  ['require','length:1,600'],
        //'thumb_image|图片' => ['require'],
        'images|图片' => ['require'],
    ];
    /**
     * 提示消息
     */
    protected $message = [
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['category_id','region_id','name','content','images'],
        'edit' => ['category_id','name','content','images'],
    ];

}
